package com.ibiaoke.system.dao;

import com.ibiaoke.common.base.BaseDao;
import com.ibiaoke.common.consts.CommonConsts;
import com.ibiaoke.system.entity.AreaProvince;
import com.ibiaoke.system.entity.AreaProvinceExample;
import com.ibiaoke.system.mapper.AreaProvinceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by biaoke on 2017/6/25.
 */
@Repository
public class AreaProvinceDao extends BaseDao<AreaProvince,AreaProvinceExample,Integer,AreaProvinceMapper> {

    @Autowired
    private AreaProvinceMapper areaProvinceMapper;
    @Override
    public AreaProvinceMapper getMapper() {
        return areaProvinceMapper;
    }

    public List<AreaProvince> listProvince() {
        AreaProvinceExample example = new AreaProvinceExample();
        example.createCriteria().andIsUsedEqualTo(CommonConsts.YES);
        return selectByExample(example);
    }
}